<template>
	<Menu class="sider-menu" theme="dark" :active-name="$route.name">
		<MenuItem :name="item.name" v-for="(item, index) in silder" :key="index" :to="item.path" >
			<Icon :type="item.meta.icon"></Icon>
			<span>{{ item.meta.title }}</span>
		</MenuItem>
	</Menu>
</template>

<script>
import rou from '../router/index.js';
export default {
	data() {
		return {
			key: rou.options.routes
		};
	},
	computed: {
		silder() {
			let silder = this.key[0].children
				.map(item => {
					if (item.name && item.meta) {
						return item;
					}
				})
				.filter(item => {
					return item;
				});
			return silder;
		}
	},
};
</script>

<style></style>
